import Vue from 'vue'
import Vuex from 'vuex'
import { homem } from "./modules/homem"
import { listm } from "./modules/listm"
// import { moviem } from "./modules/compaym"
import getlink from "../apis/getlink"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    newmovie: "",
    footerShow: true
  },
  mutations: {
    updata(state, payload) {
      state.newmovie = payload
    },
  },
  actions: {
    moviedata(context, payload) {
      this.newmovie=getlink(payload.url).then((ok) => {
        // console.log(ok.data.movie);
        context.commit("updata", ok.data.movie)
      })
    }


  },
  modules: {
    homem,
    listm,
    // moviem

  }
})
